{include file="public/header-static"/}
{include file="public/sidebar"/}


<div id="main">
    {include file="public/header"/}
    <main class="main-content">
        <div class="container">
            <div class="page-header">
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item">
                            <a href="#">首页</a>
                        </li>
                        <li class="breadcrumb-item active" aria-current="page">用户设置  </li>
                    </ol>
                </nav>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="card">
                        <div class="card-body">
                            <form action="{:url('/console/todayHotEdit')}" method="post" target="iframe_form" enctype="multipart/form-data" >
                                <div class="form-group row">
                                    <input type="hidden" value="{$info['id']}" name="id">
                                    <label for="" class="col-sm-1 col-form-label">标题</label>
                                    <div class="col-sm-8">
                                        <input type="text" name="title"  class="form-control" value="{$info['title']}" placeholder="标题">
                                    </div>
                                </div>

                                <div class="form-group row">
                                    <label for="" class="col-sm-1 col-form-label">热度值</label>
                                    <div class="col-sm-8">
                                        <input type="text" name="hot"  class="form-control" value="{$info['hot']}" placeholder="热度值">
                                    </div>
                                </div>

                                <div class="form-group row">
                                    <label class="col-sm-1 col-form-label">内容详情</label>
                                    <div class="col-sm-8">
                                        <textarea placeholder="内容详情" id="containers" name="content" type="text/plain" style="">{$info.content}</textarea>
                                    </div>
                                </div>

<!--                                <div class="form-group row">-->
<!--                                    <label class="col-sm-1 col-form-label">内容详情</label>-->
<!--                                    <div class="col-sm-8">-->
<!--                                        <textarea id="content" name="content">{$info.content}</textarea>-->
<!--                                    </div>-->
<!--                                </div>-->


                                <div class="form-group row">
                                    <label for="" class="col-sm-1 col-form-label">操作</label>
                                    <div class="col-sm-5">
                                        <div class="custom-control custom-switch custom-checkbox-secondary custom-control-inline">
                                            <input name="status" checked type="checkbox"  class="custom-control-input" id="customSwitchInline2">
                                            <label class="custom-control-label" for="customSwitchInline2">状态[是否展示]</label>
                                        </div>
                                    </div>
                                </div>
                                <button type="submit" class="btn btn-secondary">提交</button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </main>

    {include file="public/footer"/}
    <!-- 配置文件 -->
    <script type="text/javascript" src="__STATIC__/assets/js/plugins/ueditor/ueditor.config.js"></script>
    <!-- 编辑器源码文件 -->
    <script type="text/javascript" src="__STATIC__/assets/js/plugins/ueditor/ueditor.all.js"></script>

    <script>

        // http://fex.baidu.com/ueditor/#start-toolbar
        // 实例化编辑器
        var ue = UE.getEditor('containers',{
            toolbars: [
                [
                    'undo', //撤销
                    'redo', //重做
                    'bold', //加粗
                    'indent', //首行缩进
                    'italic', //斜体
                    'underline', //下划线
                    'strikethrough', //删除线
                    'subscript', //下标
                    'fontborder', //字符边框
                    'superscript', //上标
                    'formatmatch', //格式刷
                    'blockquote', //引用
                    'selectall', //全选
                    'horizontal', //分隔线
                    'removeformat', //清除格式
                    'time', //时间
                    'date', //日期
                    'fontfamily', //字体
                    'fontsize', //字号
                    'paragraph', //段落格式
                    'simpleupload', //单图上传
                    'insertimage', //多图上传
                    'emotion', //表情
                    'spechars', //特殊字符
                    'insertvideo', //视频
                    'justifyleft', //居左对齐
                    'justifyright', //居右对齐
                    'justifycenter', //居中对齐
                    'justifyjustify', //两端对齐
                    'forecolor', //字体颜色
                    'backcolor', //背景色
                    'insertorderedlist', //有序列表
                    'insertunorderedlist', //无序列表
                    'rowspacingtop', //段前距
                    'rowspacingbottom', //段后距
                    'touppercase', //字母大写
                    'tolowercase', //字母小写
                    'background', //背景
                    'scrawl', //涂鸦
                ]
            ],
            initialFrameHeight:350
        });

        // 编辑器
        layui.use('layedit', function(){
            var layedit = layui.layedit;
            // 编辑器的图片上传
            layedit.set({
                uploadImage: {
                    url: '{:url("/console/imageReturn")}?path=todayHotContent' //接口url
                    ,type: 'post' //默认post
                }
            });
            index = layedit.build('content',{
                height: 350 //设置编辑器高度
                ,hideTool:['link','unlink']
            }); //建立编辑器
        });

    </script>

</div>